<?php
/**
 * Created by PhpStorm.
 * User: Liuxc
 * Date: 2022/07/14
 * Time: 14:58
 */

namespace business\elasticsearch\types;

class BigDataDeveloperMapConfigType
{
    /**
     * mapping配置
     * @return array
     */
    public static function mapConfig()
    {
        return [
            'properties' => [
                'organizing_code'            => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
//                'title'           => ['type' => 'text', 'analyzer' => 'ik_max_word'],
                'number_of_employees'        => ['type' => 'integer'],
                'taken_land_area'            => ['type' => 'double'],
                'open_project_num'           => ['type' => 'double'],
                'purchase_demand_num'        => ['type' => 'double'],
                'cooperation_enterprise_num' => ['type' => 'double'],
                'developer_name'             => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'short_name'                 => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'developer_logo'             => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'developer_id'               => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'legal_name'                 => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'regist_capi'                => [            //todo 数据类型待确认
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'rec_capi'                   => [            //todo 数据类型待确认
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],    ////数据类型待确认
                'establish_date'             => [
                    'type'   => 'date',
                    'format' => 'yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis'
                ],
                'term_start'                 => [
                    'type'   => 'date',
                    'format' => 'yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis'
                ],
                'term_end'                   => [
                    'type'   => 'date',
                    'format' => 'yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis'
                ],
                'status'                     => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'enterprise_nature'          => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'scope'                      => ['type' => 'text', 'analyzer' => 'ik_max_word'],
                'province'                   => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'city'                       => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'province_code'              => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'city_code'                  => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'address'                    => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'company_type'               => [
                    'type'   => 'text',
                    'fields' => [
                        'keyword' => [
                            'ignore_above' => 256,
                            'type'         => 'keyword'
                        ]
                    ]
                ],
                'project_type'               => [
                    'type'       => 'nested',
                    'properties' => [
                        'project_name' => [
                            'type'   => 'text',
                            'fields' => [
                                'keyword' => [
                                    'ignore_above' => 256,
                                    'type'         => 'keyword'
                                ]
                            ]
                        ],
                    ]
                ],
            ]
        ];
    }
}
